from django import forms
#导入数据模型类
from .models import Comment

class EmailPostForm(forms.Form):
    name = forms.CharField(max_length=25)
    email = forms.EmailField()
    to = forms.EmailField()
    comments = forms.CharField(required=False,
                widget=forms.Textarea)
#chuangjianpinglunbiaodanlei
class CommentForm(forms.ModelForm):#jc
    class Meta:
        #数据模型类生成
        model = Comment
        fields = ('name','email','body')

#搜索表单代码
class SearchForm(forms.Form):
    query = forms.CharField()